import ToolActionApi from "@/tool/http/tool-action.js";

let platformAction = ToolActionApi.init("function_platform");

const rule = {
  queryParams: [],
  extendFields: [
    {
      name: "__host",
      memo: "请求主机",
      is: (watchForm) => watchForm["enum_platform_type"] === "HAI_KANG",
    },
    {
      name: "__httpsTag",
      memo: "是否https",
      is: (watchForm) => watchForm["enum_platform_type"] === "HAI_KANG",
      dictList: [
        {
          name: "是",
          val: "true",
        },
        {
          name: "否",
          val: "false",
        },
      ],
    },
  ],
  metaConfig: {},
  baseField: [
    {
      name: "id",
    },
  ],
};

export default async function () {
  rule.metaConfig.platform_id = {
    dictList: await platformAction.dict(),
  };
  return rule;
}
